package com.example.mvp.presenter

import android.util.Log
import com.example.mvp.model.IModel
import com.example.mvp.view.IView

import io.reactivex.Observer
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.disposables.Disposable

abstract open class  BasePresenter<M : IModel,V : IView> : IPresenter ,Observer<BaseEntity>{

    protected lateinit var mymodel: M
    protected lateinit var myview: V

    constructor(mymodel: M, myview: V) {
        this.mymodel = mymodel
        this.myview = myview
    }
    private var dispos = CompositeDisposable()

    override fun onSubscribe(d: Disposable) {
        dispos.add(d)
        //显示进度
    }

    override fun onNext(t: BaseEntity) {
        TODO("Not yet implemented")
    }

    override fun onError(e: Throwable) {
        Log.e("ljl", "onError: "+e.message )
    }

    override fun onComplete() {
        //隐藏进度111
    }


}